﻿ 
using System;
using System.Collections.Generic;
using System.Text;

namespace AbstractFactoryPattern.Background
{
    public  class BackgroundFactory:AbstractFactory
    {
        #region 获取对象
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <param name="flags"></param>
        /// <returns></returns>
        public override object GetObject(string flags) =>
         flags switch
         {
             "Red"=> new Red(),
             "Green"=> new Green()
         };
        #endregion
    }
}
